package abcy.cloud.authenticationserver.services.impls;

import abcy.cloud.authenticationserver.dto.req.OauthAccessTokenSelectReq;
import abcy.cloud.authenticationserver.mappers.OauthAccessTokenMapper;
import abcy.cloud.authenticationserver.services.OauthAccessTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class OauthAccessTokenServiceImpl implements OauthAccessTokenService {

    @Autowired
    private OauthAccessTokenMapper oauthAccessTokenMapper;
    @Override
    public Map<String, Object> getTokenInfo(OauthAccessTokenSelectReq oauthAccessTokenSelectReq) {
        String username =  oauthAccessTokenMapper.getTokenInfo(oauthAccessTokenSelectReq);
        Map<String, Object> map = new HashMap<>();
        map.put(oauthAccessTokenSelectReq.getToken(), username);
        return map;
    }
}
